export const checkLocationValid = () => {
    const storage = uni.getStorageSync('CURRENT_LOCATION');
    if (!storage || !storage.latitude || !storage.longitude) {
      uni.removeStorageSync('CURRENT_LOCATION');
      getApp().globalData.location || null;
      return false;
    }
      
    const validRange =
        storage.latitude > 34.5 && storage.latitude < 40.5 &&
				storage.longitude > 110.2 && storage.longitude < 114.5;
  // 时间限制改为15天（单位：毫秒）↓
  const isRecent = storage.timestamp &&
    (Date.now() - storage.timestamp) < 1296000000 * 1.5; // 15天有效期

    if (storage && isRecent && validRange) {
      return storage;
    }
    return getApp().globalData.location || null;
  }